

import java.util.ArrayList;

public class Player {

	String name;
	int score ;
	final int nbMoves;
	int gamePosition;
	ArrayList<RPSEnum> rpsList;
	
	
	public Player(String name, ArrayList<RPSEnum> rpsList) {
		super();
		this.name = name;
		this.score = 0;
		this.gamePosition=0;
		this.rpsList = rpsList;
		this.nbMoves=rpsList.size();
	}
	
	public Player(String name){
		this.name = name;
		this.score = 0;
		this.gamePosition=0;
		this.nbMoves=10;
		this.rpsList= new ArrayList<RPSEnum>();
		
		
		for (int i=0;i<nbMoves;i++){
			
			int randomCase = (int)(Math.random()*3);
			
			switch(randomCase){
			
			default:
			case 0:rpsList.add(RPSEnum.ROCK);
			break;
			case 1:rpsList.add(RPSEnum.PAPER);
			break;
			case 2:rpsList.add(RPSEnum.SCISSORS);
			}
		}
		
		
	}

	public String getName() {
		return name;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public RPSEnum getNextMove() {
		
		
		if(gamePosition<nbMoves){
			
			RPSEnum nextMove = rpsList.get(gamePosition);
			gamePosition++;
			return nextMove;
			
		}else{
			
			return null;
			
		}
		
	}


	public int getNbMoves() {
		return nbMoves;
	}
	
	
	
}
